import {defineStore} from "pinia";
import {ref} from 'vue'
import {useWsStore} from "@/stores/wsStore";

export const useCommentsStore=defineStore('comments',()=>{

    const wsStore=useWsStore()
    const response=ref({})

    const setResponse=(data)=>{
        response.value=data
    }

    const getResponse=()=>{
        return response.value
    }

    const responseUser=(data)=>{
        //处理逻辑

        //需要websocket实现
        wsStore.init()
    }

    return {
        response,
        setResponse,
        getResponse,
        responseUser
    }
},{
    persist:true
})
